package com.mida.app.report.controller.reqeustform;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mida.app.report.service.RequestFormService;
import com.mida.app.report.vo.request.RegistrationListCompleteInfoVo;
import com.mida.app.report.vo.request.reqeustform.RegistrationListRequest;
import com.mida.tool.common.ret.RespBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



@RestController
@RequestMapping("/report-app/requestform")
@Api(tags = "申请单相关功能")
@Slf4j
public class RequestFormController {

    @Autowired
    private RequestFormService requestFormServiceImpl;

    /**
     * @Author guoqiubo
     * @Date 2021-05-19 10:33:34
     * @Description 服务拆分后登记页面、预约页面的列表查询，以申请单为展示维度，包含检查项信息。
     * @Param
     * @Return
     * @Since version-1.0
     */
    @ApiOperation(value = "登记预约查询包含已完成申请单列表接口")
    @RequestMapping(value = "/queryAllRequestPage", method = RequestMethod.POST,
            consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"})
    public RespBody<IPage<RegistrationListCompleteInfoVo>> queryAllRequestPage(@RequestBody RegistrationListRequest request) {
        Page<RegistrationListCompleteInfoVo> records = requestFormServiceImpl.queryAllRequestFormPageInfo(request);
        RespBody respBody = new RespBody(JSON.toJSON(records));
        return respBody;
    }
}